home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / ColorSync 2.1.2 GM / Interfaces / CIncludes / CMApplication.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-18  |  35.0 KB  |  980 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMApplication.h
  3.  
  4.      Contains:    Color Matching Interfaces
  5.  
  6.      Version:    ColorSync 2.1
  7.  
  8.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  9.                  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18.  
  19. #ifndef __CMAPPLICATION__
  20. #define __CMAPPLICATION__
  21.  
  22. #ifndef __TYPES__
  23. #include <Types.h>
  24. #endif
  25. #ifndef __QUICKDRAW__
  26. #include <Quickdraw.h>
  27. #endif
  28. #ifndef __FILES__
  29. #include <Files.h>
  30. #endif
  31. #ifndef __PRINTING__
  32. #include <Printing.h>
  33. #endif
  34. #ifndef __CMICCPROFILE__
  35. #include <CMICCProfile.h>
  36. #endif
  37.  
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41.  
  42. #if PRAGMA_IMPORT_SUPPORTED
  43. #pragma import on
  44. #endif
  45.  
  46. #if PRAGMA_ALIGN_SUPPORTED
  47. #pragma options align=mac68k
  48. #endif
  49.  
  50.  
  51. enum {
  52.     gestaltColorSync20            = 0x0200,
  53.     gestaltColorSync21            = 0x0210
  54. };
  55.  
  56. enum {
  57.     kDefaultCMMSignature        = 'appl'
  58. };
  59.  
  60. /* Macintosh 68K trap word */
  61.  
  62. enum {
  63.     cmTrap                        = 0xABEE
  64. };
  65.  
  66. /* PicComment IDs */
  67.  
  68. enum {
  69.     cmBeginProfile                = 220,
  70.     cmEndProfile                = 221,
  71.     cmEnableMatching            = 222,
  72.     cmDisableMatching            = 223,
  73.     cmComment                    = 224
  74. };
  75.  
  76. /* PicComment selectors for cmComment */
  77.  
  78. enum {
  79.     cmBeginProfileSel            = 0,
  80.     cmContinueProfileSel        = 1,
  81.     cmEndProfileSel                = 2,
  82.     cmProfileIdentifierSel        = 3
  83. };
  84.  
  85. /* Defines for version 1.0 CMProfileSearchRecord.fieldMask */
  86.  
  87. enum {
  88.     cmMatchCMMType                = 0x00000001,
  89.     cmMatchApplProfileVersion    = 0x00000002,
  90.     cmMatchDataType                = 0x00000004,
  91.     cmMatchDeviceType            = 0x00000008,
  92.     cmMatchDeviceManufacturer    = 0x00000010,
  93.     cmMatchDeviceModel            = 0x00000020,
  94.     cmMatchDeviceAttributes        = 0x00000040,
  95.     cmMatchFlags                = 0x00000080,
  96.     cmMatchOptions                = 0x00000100,
  97.     cmMatchWhite                = 0x00000200,
  98.     cmMatchBlack                = 0x00000400
  99. };
  100.  
  101. /* Defines for version 2.0 CMSearchRecord.searchMask */
  102.  
  103. enum {
  104.     cmMatchAnyProfile            = 0x00000000,
  105.     cmMatchProfileCMMType        = 0x00000001,
  106.     cmMatchProfileClass            = 0x00000002,
  107.     cmMatchDataColorSpace        = 0x00000004,
  108.     cmMatchProfileConnectionSpace = 0x00000008,
  109.     cmMatchManufacturer            = 0x00000010,
  110.     cmMatchModel                = 0x00000020,
  111.     cmMatchAttributes            = 0x00000040,
  112.     cmMatchProfileFlags            = 0x00000080
  113. };
  114.  
  115. /* Result codes */
  116.  
  117. enum {
  118.                                                                 /* General Errors */
  119.     cmProfileError                = -170,
  120.     cmMethodError                = -171,
  121.     cmMethodNotFound            = -175,                            /* CMM not present */
  122.     cmProfileNotFound            = -176,                            /* Responder error */
  123.     cmProfilesIdentical            = -177,                            /* Profiles the same */
  124.     cmCantConcatenateError        = -178,                            /* Profile can't be concatenated */
  125.     cmCantXYZ                    = -179,                            /* CMM cant handle XYZ space */
  126.     cmCantDeleteProfile            = -180,                            /* Responder error */
  127.     cmUnsupportedDataType        = -181,                            /* Responder error */
  128.     cmNoCurrentProfile            = -182,                            /* Responder error */
  129.                                                                 /* Profile Access Errors */
  130.     cmElementTagNotFound        = -4200,
  131.     cmIndexRangeErr                = -4201,                        /* Tag index out of range */
  132.     cmCantDeleteElement            = -4202,
  133.     cmFatalProfileErr            = -4203,
  134.     cmInvalidProfile            = -4204,                        /* A Profile must contain a 'cs1 ' tag to be valid */
  135.     cmInvalidProfileLocation    = -4205,                        /* Operation not supported for this profile location */
  136.     cmCantCopyModifiedV1Profile    = -4215,                        /* Illegal to copy version 1 profiles that have been modified */
  137.                                                                 /* Profile Search Errors */
  138.     cmInvalidSearch                = -4206,                        /* Bad Search Handle */
  139.     cmSearchError                = -4207,
  140.     cmErrIncompatibleProfile    = -4208,                        /* Other ColorSync Errors */
  141.     cmInvalidColorSpace            = -4209,                        /* Profile colorspace does not match bitmap type */
  142.     cmInvalidSrcMap                = -4210,                        /* Source pix/bit map was invalid */
  143.     cmInvalidDstMap                = -4211,                        /* Destination pix/bit map was invalid */
  144.     cmNoGDevicesError            = -4212,                        /* Begin/End Matching -- no gdevices available */
  145.     cmInvalidProfileComment        = -4213,                        /* Bad Profile comment during drawpicture */
  146.     cmRangeOverFlow                = -4214,                        /* Color conversion warning that some output color values over/underflowed and were clipped */
  147.     cmNamedColorNotFound        = -4216,                        /* NamedColor not found */
  148.     cmCantGamutCheckError        = -4217                            /* Gammut checking not supported by this ColorWorld */
  149. };
  150.  
  151. /* deviceType values for ColorSync 1.0 Device Profile access */
  152.  
  153. enum {
  154.     cmSystemDevice                = 'sys ',
  155.     cmGDevice                    = 'gdev'
  156. };
  157.  
  158. /* Commands for CMFlattenUPP(…) */
  159.  
  160. enum {
  161.     cmOpenReadSpool                = 1,
  162.     cmOpenWriteSpool            = 2,
  163.     cmReadSpool                    = 3,
  164.     cmWriteSpool                = 4,
  165.     cmCloseSpool                = 5
  166. };
  167.  
  168. /* Flags for PostScript-related functions */
  169.  
  170. enum {
  171.     cmPS7bit                    = 1,
  172.     cmPS8bit                    = 2
  173. };
  174.  
  175. /* Flags for profile embedding functions */
  176.  
  177. enum {
  178.     cmEmbedWholeProfile            = 0x00000000,
  179.     cmEmbedProfileIdentifier    = 0x00000001
  180. };
  181.  
  182. /* Commands for CMAccessUPP(…) */
  183.  
  184. enum {
  185.     cmOpenReadAccess            = 1,
  186.     cmOpenWriteAccess            = 2,
  187.     cmReadAccess                = 3,
  188.     cmWriteAccess                = 4,
  189.     cmCloseAccess                = 5,
  190.     cmCreateNewAccess            = 6,
  191.     cmAbortWriteAccess            = 7,
  192.     cmBeginAccess                = 8,
  193.     cmEndAccess                    = 9
  194. };
  195.  
  196. /* Abstract data type for memory-based Profile */
  197. typedef struct OpaqueCMProfileRef* CMProfileRef;
  198. /* Abstract data type for Profile search result */
  199. typedef struct OpaqueCMProfileSearchRef* CMProfileSearchRef;
  200. /* Abstract data type for BeginMatching(…) reference */
  201. typedef struct OpaqueCMMatchRef* CMMatchRef;
  202. /* Abstract data type for ColorWorld reference */
  203. typedef struct OpaqueCMWorldRef* CMWorldRef;
  204. /* Caller-supplied flatten function */
  205. typedef pascal OSErr (*CMFlattenProcPtr)(long command, long *size, void *data, void *refCon);
  206. /* Caller-supplied progress function for Bitmap & PixMap matching routines */
  207. typedef pascal Boolean (*CMBitmapCallBackProcPtr)(long progress, void *refCon);
  208. /* Caller-supplied filter function for Profile search */
  209. typedef pascal Boolean (*CMProfileFilterProcPtr)(CMProfileRef prof, void *refCon);
  210. /* Caller-supplied function for profile access */
  211. typedef pascal OSErr (*CMProfileAccessProcPtr)(long command, long offset, long *size, void *data, void *refCon);
  212.  
  213. #if GENERATINGCFM
  214. typedef UniversalProcPtr CMFlattenUPP;
  215. typedef UniversalProcPtr CMBitmapCallBackUPP;
  216. typedef UniversalProcPtr CMProfileFilterUPP;
  217. typedef UniversalProcPtr CMProfileAccessUPP;
  218. #else
  219. typedef CMFlattenProcPtr CMFlattenUPP;
  220. typedef CMBitmapCallBackProcPtr CMBitmapCallBackUPP;
  221. typedef CMProfileFilterProcPtr CMProfileFilterUPP;
  222. typedef CMProfileAccessProcPtr CMProfileAccessUPP;
  223. #endif
  224.  
  225. enum {
  226.     uppCMFlattenProcInfo = kPascalStackBased
  227.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  228.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  229.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long *)))
  230.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
  231.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void *))),
  232.     uppCMBitmapCallBackProcInfo = kPascalStackBased
  233.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  234.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  235.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *))),
  236.     uppCMProfileFilterProcInfo = kPascalStackBased
  237.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  238.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(CMProfileRef)))
  239.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *))),
  240.     uppCMProfileAccessProcInfo = kPascalStackBased
  241.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  242.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  243.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  244.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long *)))
  245.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void *)))
  246.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void *)))
  247. };
  248.  
  249. #if GENERATINGCFM
  250. #define NewCMFlattenProc(userRoutine)        \
  251.         (CMFlattenUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMFlattenProcInfo, GetCurrentArchitecture())
  252. #define NewCMBitmapCallBackProc(userRoutine)        \
  253.         (CMBitmapCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMBitmapCallBackProcInfo, GetCurrentArchitecture())
  254. #define NewCMProfileFilterProc(userRoutine)        \
  255.         (CMProfileFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileFilterProcInfo, GetCurrentArchitecture())
  256. #define NewCMProfileAccessProc(userRoutine)        \
  257.         (CMProfileAccessUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileAccessProcInfo, GetCurrentArchitecture())
  258. #else
  259. #define NewCMFlattenProc(userRoutine)        \
  260.         ((CMFlattenUPP) (userRoutine))
  261. #define NewCMBitmapCallBackProc(userRoutine)        \
  262.         ((CMBitmapCallBackUPP) (userRoutine))
  263. #define NewCMProfileFilterProc(userRoutine)        \
  264.         ((CMProfileFilterUPP) (userRoutine))
  265. #define NewCMProfileAccessProc(userRoutine)        \
  266.         ((CMProfileAccessUPP) (userRoutine))
  267. #endif
  268.  
  269. #if GENERATINGCFM
  270. #define CallCMFlattenProc(userRoutine, command, size, data, refCon)        \
  271.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppCMFlattenProcInfo, (command), (size), (data), (refCon))
  272. #define CallCMBitmapCallBackProc(userRoutine, progress, refCon)        \
  273.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppCMBitmapCallBackProcInfo, (progress), (refCon))
  274. #define CallCMProfileFilterProc(userRoutine, prof, refCon)        \
  275.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppCMProfileFilterProcInfo, (prof), (refCon))
  276. #define CallCMProfileAccessProc(userRoutine, command, offset, size, data, refCon)        \
  277.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppCMProfileAccessProcInfo, (command), (offset), (size), (data), (refCon))
  278. #else
  279. #define CallCMFlattenProc(userRoutine, command, size, data, refCon)        \
  280.         (*(userRoutine))((command), (size), (data), (refCon))
  281. #define CallCMBitmapCallBackProc(userRoutine, progress, refCon)        \
  282.         (*(userRoutine))((progress), (refCon))
  283. #define CallCMProfileFilterProc(userRoutine, prof, refCon)        \
  284.         (*(userRoutine))((prof), (refCon))
  285. #define CallCMProfileAccessProc(userRoutine, command, offset, size, data, refCon)        \
  286.         (*(userRoutine))((command), (offset), (size), (data), (refCon))
  287. #endif
  288.  
  289. typedef long CMError;
  290.  
  291. /* For 1.0 and 2.0 profile header variants */
  292. /* CMAppleProfileHeader */
  293. union CMAppleProfileHeader {
  294.     CMHeader                         cm1;
  295.     CM2Header                         cm2;
  296. };
  297. typedef union CMAppleProfileHeader CMAppleProfileHeader;
  298.  
  299. /* Param for CWConcatColorWorld(…) */
  300. struct CMConcatProfileSet {
  301.     unsigned short                     keyIndex;                    /* Zero-based */
  302.     unsigned short                     count;                        /* Min 1 */
  303.     CMProfileRef                     profileSet[1];                /* Variable. Ordered from Source -> Dest */
  304. };
  305. typedef struct CMConcatProfileSet CMConcatProfileSet;
  306.  
  307. /* ColorSync color data types */
  308. struct CMRGBColor {
  309.     unsigned short                     red;                        /* 0..65535 */
  310.     unsigned short                     green;
  311.     unsigned short                     blue;
  312. };
  313. typedef struct CMRGBColor CMRGBColor;
  314.  
  315. struct CMCMYKColor {
  316.     unsigned short                     cyan;                        /* 0..65535 */
  317.     unsigned short                     magenta;
  318.     unsigned short                     yellow;
  319.     unsigned short                     black;
  320. };
  321. typedef struct CMCMYKColor CMCMYKColor;
  322.  
  323. struct CMCMYColor {
  324.     unsigned short                     cyan;                        /* 0..65535 */
  325.     unsigned short                     magenta;
  326.     unsigned short                     yellow;
  327. };
  328. typedef struct CMCMYColor CMCMYColor;
  329.  
  330. struct CMHLSColor {
  331.     unsigned short                     hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  332.     unsigned short                     lightness;                    /* 0..65535 */
  333.     unsigned short                     saturation;                    /* 0..65535 */
  334. };
  335. typedef struct CMHLSColor CMHLSColor;
  336.  
  337. struct CMHSVColor {
  338.     unsigned short                     hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  339.     unsigned short                     saturation;                    /* 0..65535 */
  340.     unsigned short                     value;                        /* 0..65535 */
  341. };
  342. typedef struct CMHSVColor CMHSVColor;
  343.  
  344. struct CMLabColor {
  345.     unsigned short                     L;                            /* 0..65535 maps to 0..100 */
  346.     unsigned short                     a;                            /* 0..65535 maps to -128..127.996 */
  347.     unsigned short                     b;                            /* 0..65535 maps to -128..127.996 */
  348. };
  349. typedef struct CMLabColor CMLabColor;
  350.  
  351. struct CMLuvColor {
  352.     unsigned short                     L;                            /* 0..65535 maps to 0..100 */
  353.     unsigned short                     u;                            /* 0..65535 maps to -128..127.996 */
  354.     unsigned short                     v;                            /* 0..65535 maps to -128..127.996 */
  355. };
  356. typedef struct CMLuvColor CMLuvColor;
  357.  
  358. struct CMYxyColor {
  359.     unsigned short                     capY;                        /* 0..65535 maps to 0..1 */
  360.     unsigned short                     x;                            /* 0..65535 maps to 0..1 */
  361.     unsigned short                     y;                            /* 0..65535 maps to 0..1 */
  362. };
  363. typedef struct CMYxyColor CMYxyColor;
  364.  
  365. struct CMGrayColor {
  366.     unsigned short                     gray;                        /* 0..65535 */
  367. };
  368. typedef struct CMGrayColor CMGrayColor;
  369.  
  370. struct CMMultichannel5Color {
  371.     unsigned char                     components[5];                /* 0..255 */
  372. };
  373. typedef struct CMMultichannel5Color CMMultichannel5Color;
  374.  
  375. struct CMMultichannel6Color {
  376.     unsigned char                     components[6];                /* 0..255 */
  377. };
  378. typedef struct CMMultichannel6Color CMMultichannel6Color;
  379.  
  380. struct CMMultichannel7Color {
  381.     unsigned char                     components[7];                /* 0..255 */
  382. };
  383. typedef struct CMMultichannel7Color CMMultichannel7Color;
  384.  
  385. struct CMMultichannel8Color {
  386.     unsigned char                     components[8];                /* 0..255 */
  387. };
  388. typedef struct CMMultichannel8Color CMMultichannel8Color;
  389.  
  390. struct CMNamedColor {
  391.     unsigned long                     namedColorIndex;            /* 0..a lot */
  392. };
  393. typedef struct CMNamedColor CMNamedColor;
  394.  
  395. union CMColor {
  396.     CMRGBColor                         rgb;
  397.     CMHSVColor                         hsv;
  398.     CMHLSColor                         hls;
  399.     CMXYZColor                         XYZ;
  400.     CMLabColor                         Lab;
  401.     CMLuvColor                         Luv;
  402.     CMYxyColor                         Yxy;
  403.     CMCMYKColor                     cmyk;
  404.     CMCMYColor                         cmy;
  405.     CMGrayColor                     gray;
  406.     CMMultichannel5Color             mc5;
  407.     CMMultichannel6Color             mc6;
  408.     CMMultichannel7Color             mc7;
  409.     CMMultichannel8Color             mc8;
  410.     CMNamedColor                     namedColor;
  411. };
  412. typedef union CMColor CMColor;
  413.  
  414. struct CMProfileSearchRecord {
  415.     CMHeader                         header;
  416.     unsigned long                     fieldMask;
  417.     unsigned long                     reserved[2];
  418. };
  419. typedef struct CMProfileSearchRecord CMProfileSearchRecord;
  420.  
  421. typedef CMProfileSearchRecord *CMProfileSearchRecordPtr;
  422. typedef CMProfileSearchRecordPtr *CMProfileSearchRecordHandle;
  423. /* Search definition for 2.0 */
  424. struct CMSearchRecord {
  425.     OSType                             CMMType;
  426.     OSType                             profileClass;
  427.     OSType                             dataColorSpace;
  428.     OSType                             profileConnectionSpace;
  429.     unsigned long                     deviceManufacturer;
  430.     unsigned long                     deviceModel;
  431.     unsigned long                     deviceAttributes[2];
  432.     unsigned long                     profileFlags;
  433.     unsigned long                     searchMask;
  434.     CMProfileFilterUPP                 filter;
  435. };
  436. typedef struct CMSearchRecord CMSearchRecord;
  437.  
  438. /* GetCWInfo structures */
  439. struct CMMInfoRecord {
  440.     OSType                             CMMType;
  441.     long                             CMMVersion;
  442. };
  443. typedef struct CMMInfoRecord CMMInfoRecord;
  444.  
  445. struct CMCWInfoRecord {
  446.     unsigned long                     cmmCount;
  447.     CMMInfoRecord                     cmmInfo[2];
  448. };
  449. typedef struct CMCWInfoRecord CMCWInfoRecord;
  450.  
  451. /* profile identifier structures */
  452. struct CMProfileIdentifier {
  453.     CM2Header                         profileHeader;
  454.     CMDateTime                         calibrationDate;
  455.     unsigned long                     ASCIIProfileDescriptionLen;
  456.     char                             ASCIIProfileDescription[1];    /* variable length */
  457. };
  458. typedef struct CMProfileIdentifier CMProfileIdentifier;
  459.  
  460. typedef CMProfileIdentifier *CMProfileIdentifierPtr;
  461. /* packing formats */
  462.  
  463. enum {
  464.     cmNoColorPacking            = 0x0000,
  465.     cmAlphaSpace                = 0x0080,
  466.     cmWord5ColorPacking            = 0x0500,
  467.     cmLong8ColorPacking            = 0x0800,
  468.     cmLong10ColorPacking        = 0x0A00,
  469.     cmAlphaFirstPacking            = 0x1000,
  470.     cmOneBitDirectPacking        = 0x0B00,
  471.     cmAlphaLastPacking            = 0x0000,
  472.     cm24_8ColorPacking            = 0x2100,
  473.     cm32_8ColorPacking            = cmLong8ColorPacking,
  474.     cm40_8ColorPacking            = 0x2200,
  475.     cm48_8ColorPacking            = 0x2300,
  476.     cm56_8ColorPacking            = 0x2400,
  477.     cm64_8ColorPacking            = 0x2500,
  478.     cm32_16ColorPacking            = 0x2600,
  479.     cm32_32ColorPacking            = 0x2700
  480. };
  481.  
  482. /* general colorspaces */
  483.  
  484. enum {
  485.     cmNoSpace                    = 0,
  486.     cmRGBSpace                    = 1,
  487.     cmCMYKSpace                    = 2,
  488.     cmHSVSpace                    = 3,
  489.     cmHLSSpace                    = 4,
  490.     cmYXYSpace                    = 5,
  491.     cmXYZSpace                    = 6,
  492.     cmLUVSpace                    = 7,
  493.     cmLABSpace                    = 8,
  494.     cmReservedSpace1            = 9,
  495.     cmGraySpace                    = 10,
  496.     cmReservedSpace2            = 11,
  497.     cmGamutResultSpace            = 12,
  498.     cmNamedIndexedSpace            = 16,
  499.     cmMCFiveSpace                = 17,
  500.     cmMCSixSpace                = 18,
  501.     cmMCSevenSpace                = 19,
  502.     cmMCEightSpace                = 20
  503. };
  504.  
  505. /* supported CMBitmapColorSpaces - each of the following is a */
  506. /* combination of a general colospace and a packing formats */
  507.  
  508. enum {
  509.     cmRGBASpace                    = cmRGBSpace + cmAlphaSpace,
  510.     cmGrayASpace                = cmGraySpace + cmAlphaSpace,
  511.     cmRGB16Space                = cmWord5ColorPacking + cmRGBSpace,
  512.     cmRGB32Space                = cmLong8ColorPacking + cmRGBSpace,
  513.     cmARGB32Space                = cmLong8ColorPacking + cmAlphaFirstPacking + cmRGBASpace,
  514.     cmCMYK32Space                = cmLong8ColorPacking + cmCMYKSpace,
  515.     cmHSV32Space                = cmLong10ColorPacking + cmHSVSpace,
  516.     cmHLS32Space                = cmLong10ColorPacking + cmHLSSpace,
  517.     cmYXY32Space                = cmLong10ColorPacking + cmYXYSpace,
  518.     cmXYZ32Space                = cmLong10ColorPacking + cmXYZSpace,
  519.     cmLUV32Space                = cmLong10ColorPacking + cmLUVSpace,
  520.     cmLAB32Space                = cmLong10ColorPacking + cmLABSpace,
  521.     cmGamutResult1Space            = cmOneBitDirectPacking + cmGamutResultSpace,
  522.     cmRGB24Space                = cm24_8ColorPacking + cmRGBSpace,
  523.     cmRGBA32Space                = cm32_8ColorPacking + cmAlphaLastPacking + cmRGBASpace,
  524.     cmLAB24Space                = cm24_8ColorPacking + cmLABSpace,
  525.     cmNamedIndexed32Space        = cm32_32ColorPacking + cmNamedIndexedSpace,
  526.     cmMCFive8Space                = cm40_8ColorPacking + cmMCFiveSpace,
  527.     cmMCSix8Space                = cm48_8ColorPacking + cmMCSixSpace,
  528.     cmMCSeven8Space                = cm56_8ColorPacking + cmMCSevenSpace,
  529.     cmMCEight8Space                = cm64_8ColorPacking + cmMCEightSpace
  530. };
  531.  
  532. typedef unsigned long CMBitmapColorSpace;
  533. struct CMBitmap {
  534.     char *                            image;
  535.     long                             width;
  536.     long                             height;
  537.     long                             rowBytes;
  538.     long                             pixelSize;
  539.     CMBitmapColorSpace                 space;
  540.     long                             user1;
  541.     long                             user2;
  542. };
  543. typedef struct CMBitmap CMBitmap;
  544.  
  545. /* Classic Print Manager Stuff */
  546.  
  547. enum {
  548.     enableColorMatchingOp        = 12,
  549.     registerProfileOp            = 13
  550. };
  551.  
  552.  
  553. enum {
  554.     cmNoProfileBase                = 0,
  555.     cmFileBasedProfile            = 1,
  556.     cmHandleBasedProfile        = 2,
  557.     cmPtrBasedProfile            = 3,
  558.     cmProcedureBasedProfile        = 4
  559. };
  560.  
  561. struct CMFileLocation {
  562.     FSSpec                             spec;
  563. };
  564. typedef struct CMFileLocation CMFileLocation;
  565.  
  566. struct CMHandleLocation {
  567.     Handle                             h;
  568. };
  569. typedef struct CMHandleLocation CMHandleLocation;
  570.  
  571. struct CMPtrLocation {
  572.     Ptr                             p;
  573. };
  574. typedef struct CMPtrLocation CMPtrLocation;
  575.  
  576. struct CMProcedureLocation {
  577.     CMProfileAccessUPP                 proc;
  578.     void *                            refCon;
  579. };
  580. typedef struct CMProcedureLocation CMProcedureLocation;
  581.  
  582. union CMProfLoc {
  583.     CMFileLocation                     fileLoc;
  584.     CMHandleLocation                 handleLoc;
  585.     CMPtrLocation                     ptrLoc;
  586.  
  587.     CMProcedureLocation             procLoc;
  588.  
  589. };
  590. typedef union CMProfLoc CMProfLoc;
  591.  
  592. struct CMProfileLocation {
  593.     short                             locType;
  594.     CMProfLoc                         u;
  595. };
  596. typedef struct CMProfileLocation CMProfileLocation;
  597.  
  598. /* Profile file and element access */
  599. extern pascal CMError CMNewProfile(CMProfileRef *prof, const CMProfileLocation *theProfile)
  600.  FOURWORDINLINE(0x203C, 0x0008, 0x001B, 0xABEE);
  601.  
  602. extern pascal CMError CMOpenProfile(CMProfileRef *prof, const CMProfileLocation *theProfile)
  603.  FOURWORDINLINE(0x203C, 0x0008, 0x001C, 0xABEE);
  604.  
  605. extern pascal CMError CMCloseProfile(CMProfileRef prof)
  606.  FOURWORDINLINE(0x203C, 0x0004, 0x001D, 0xABEE);
  607.  
  608. extern pascal CMError CMUpdateProfile(CMProfileRef prof)
  609.  FOURWORDINLINE(0x203C, 0x0004, 0x0034, 0xABEE);
  610.  
  611. extern pascal CMError CMCopyProfile(CMProfileRef *targetProf, const CMProfileLocation *targetLocation, CMProfileRef srcProf)
  612.  FOURWORDINLINE(0x203C, 0x000C, 0x0025, 0xABEE);
  613.  
  614. extern pascal CMError CMValidateProfile(CMProfileRef prof, Boolean *valid, Boolean *preferredCMMnotfound)
  615.  FOURWORDINLINE(0x203C, 0x000C, 0x0026, 0xABEE);
  616.  
  617. extern pascal CMError CMGetProfileLocation(CMProfileRef prof, CMProfileLocation *theProfile)
  618.  FOURWORDINLINE(0x203C, 0x0008, 0x003C, 0xABEE);
  619.  
  620. extern pascal CMError CMFlattenProfile(CMProfileRef prof, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  621.  FOURWORDINLINE(0x203C, 0x0014, 0x0031, 0xABEE);
  622.  
  623. extern pascal CMError CMUnflattenProfile(FSSpec *resultFileSpec, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  624.  FOURWORDINLINE(0x203C, 0x0010, 0x0032, 0xABEE);
  625.  
  626. extern pascal CMError CMGetProfileHeader(CMProfileRef prof, CMAppleProfileHeader *header)
  627.  FOURWORDINLINE(0x203C, 0x0008, 0x0039, 0xABEE);
  628.  
  629. extern pascal CMError CMSetProfileHeader(CMProfileRef prof, const CMAppleProfileHeader *header)
  630.  FOURWORDINLINE(0x203C, 0x0008, 0x003A, 0xABEE);
  631.  
  632. extern pascal CMError CMProfileElementExists(CMProfileRef prof, OSType tag, Boolean *found)
  633.  FOURWORDINLINE(0x203C, 0x000C, 0x001E, 0xABEE);
  634.  
  635. extern pascal CMError CMCountProfileElements(CMProfileRef prof, unsigned long *elementCount)
  636.  FOURWORDINLINE(0x203C, 0x0008, 0x001F, 0xABEE);
  637.  
  638. extern pascal CMError CMGetProfileElement(CMProfileRef prof, OSType tag, unsigned long *elementSize, void *elementData)
  639.  FOURWORDINLINE(0x203C, 0x0010, 0x0020, 0xABEE);
  640.  
  641. extern pascal CMError CMSetProfileElement(CMProfileRef prof, OSType tag, unsigned long elementSize, void *elementData)
  642.  FOURWORDINLINE(0x203C, 0x0010, 0x0023, 0xABEE);
  643.  
  644. extern pascal CMError CMSetProfileElementSize(CMProfileRef prof, OSType tag, unsigned long elementSize)
  645.  FOURWORDINLINE(0x203C, 0x000C, 0x0038, 0xABEE);
  646.  
  647. extern pascal CMError CMSetProfileElementReference(CMProfileRef prof, OSType elementTag, OSType referenceTag)
  648.  FOURWORDINLINE(0x203C, 0x000C, 0x0035, 0xABEE);
  649.  
  650. extern pascal CMError CMGetPartialProfileElement(CMProfileRef prof, OSType tag, unsigned long offset, unsigned long *byteCount, void *elementData)
  651.  FOURWORDINLINE(0x203C, 0x0014, 0x0036, 0xABEE);
  652.  
  653. extern pascal CMError CMSetPartialProfileElement(CMProfileRef prof, OSType tag, unsigned long offset, unsigned long byteCount, void *elementData)
  654.  FOURWORDINLINE(0x203C, 0x0014, 0x0037, 0xABEE);
  655.  
  656. extern pascal CMError CMGetIndProfileElementInfo(CMProfileRef prof, unsigned long index, OSType *tag, unsigned long *elementSize, Boolean *refs)
  657.  FOURWORDINLINE(0x203C, 0x0014, 0x0021, 0xABEE);
  658.  
  659. extern pascal CMError CMGetIndProfileElement(CMProfileRef prof, unsigned long index, unsigned long *elementSize, void *elementData)
  660.  FOURWORDINLINE(0x203C, 0x0010, 0x0022, 0xABEE);
  661.  
  662. extern pascal CMError CMRemoveProfileElement(CMProfileRef prof, OSType tag)
  663.  FOURWORDINLINE(0x203C, 0x0008, 0x0024, 0xABEE);
  664.  
  665. extern pascal CMError CMGetScriptProfileDescription(CMProfileRef prof, Str255 name, ScriptCode *code)
  666.  FOURWORDINLINE(0x203C, 0x000C, 0x003E, 0xABEE);
  667.  
  668. extern pascal CMError CMCloneProfileRef(CMProfileRef prof)
  669.  FOURWORDINLINE(0x203C, 0x0004, 0x0042, 0xABEE);
  670.  
  671. extern pascal CMError CMGetProfileRefCount(CMProfileRef prof, long *count)
  672.  FOURWORDINLINE(0x203C, 0x0008, 0x0043, 0xABEE);
  673.  
  674. extern pascal CMError CMProfileModified(CMProfileRef prof, Boolean *modified)
  675.  FOURWORDINLINE(0x203C, 0x0008, 0x0044, 0xABEE);
  676.  
  677. /* named Color access functions */
  678. extern pascal CMError CMGetNamedColorInfo(CMProfileRef prof, unsigned long *deviceChannels, OSType *deviceColorSpace, OSType *PCSColorSpace, unsigned long *count, StringPtr prefix, StringPtr suffix)
  679.  FOURWORDINLINE(0x203C, 0x001C, 0x0046, 0xABEE);
  680.  
  681. extern pascal CMError CMGetNamedColorValue(CMProfileRef prof, StringPtr name, CMColor *deviceColor, CMColor *PCSColor)
  682.  FOURWORDINLINE(0x203C, 0x0010, 0x0047, 0xABEE);
  683.  
  684. extern pascal CMError CMGetIndNamedColorValue(CMProfileRef prof, unsigned long index, CMColor *deviceColor, CMColor *PCSColor)
  685.  FOURWORDINLINE(0x203C, 0x0010, 0x0048, 0xABEE);
  686.  
  687. extern pascal CMError CMGetNamedColorIndex(CMProfileRef prof, StringPtr name, unsigned long *index)
  688.  FOURWORDINLINE(0x203C, 0x000C, 0x0049, 0xABEE);
  689.  
  690. extern pascal CMError CMGetNamedColorName(CMProfileRef prof, unsigned long index, StringPtr name)
  691.  FOURWORDINLINE(0x203C, 0x000C, 0x004A, 0xABEE);
  692.  
  693. /* Low-level matching functions */
  694. extern pascal CMError NCWNewColorWorld(CMWorldRef *cw, CMProfileRef src, CMProfileRef dst)
  695.  FOURWORDINLINE(0x203C, 0x000C, 0x0014, 0xABEE);
  696.  
  697. extern pascal CMError CWConcatColorWorld(CMWorldRef *cw, CMConcatProfileSet *profileSet)
  698.  FOURWORDINLINE(0x203C, 0x0008, 0x0015, 0xABEE);
  699.  
  700. extern pascal CMError CWNewLinkProfile(CMProfileRef *prof, const CMProfileLocation *targetLocation, CMConcatProfileSet *profileSet)
  701.  FOURWORDINLINE(0x203C, 0x000C, 0x0033, 0xABEE);
  702.  
  703. extern pascal void CWDisposeColorWorld(CMWorldRef cw)
  704.  FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xABEE);
  705.  
  706. extern pascal CMError CWMatchColors(CMWorldRef cw, CMColor *myColors, unsigned long count)
  707.  FOURWORDINLINE(0x203C, 0x000C, 0x0002, 0xABEE);
  708.  
  709. extern pascal CMError CWCheckColors(CMWorldRef cw, CMColor *myColors, unsigned long count, long *result)
  710.  FOURWORDINLINE(0x203C, 0x0010, 0x0003, 0xABEE);
  711.  
  712. /* Bitmap matching */
  713. extern pascal CMError CWMatchBitmap(CMWorldRef cw, CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *matchedBitmap)
  714.  FOURWORDINLINE(0x203C, 0x0010, 0x002C, 0xABEE);
  715.  
  716. extern pascal CMError CWCheckBitmap(CMWorldRef cw, const CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *resultBitmap)
  717.  FOURWORDINLINE(0x203C, 0x0014, 0x002D, 0xABEE);
  718.  
  719. /* Quickdraw-specific matching */
  720. extern pascal CMError CWMatchPixMap(CMWorldRef cw, PixMap *myPixMap, CMBitmapCallBackUPP progressProc, void *refCon)
  721.  FOURWORDINLINE(0x203C, 0x0010, 0x0004, 0xABEE);
  722.  
  723. extern pascal CMError CWCheckPixMap(CMWorldRef cw, PixMap *myPixMap, CMBitmapCallBackUPP progressProc, void *refCon, BitMap *resultBitMap)
  724.  FOURWORDINLINE(0x203C, 0x0014, 0x0007, 0xABEE);
  725.  
  726. extern pascal CMError NCMBeginMatching(CMProfileRef src, CMProfileRef dst, CMMatchRef *myRef)
  727.  FOURWORDINLINE(0x203C, 0x000C, 0x0016, 0xABEE);
  728.  
  729. extern pascal void CMEndMatching(CMMatchRef myRef)
  730.  FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xABEE);
  731.  
  732. extern pascal void NCMDrawMatchedPicture(PicHandle myPicture, CMProfileRef dst, Rect *myRect)
  733.  FOURWORDINLINE(0x203C, 0x000C, 0x0017, 0xABEE);
  734.  
  735. extern pascal void CMEnableMatchingComment(Boolean enableIt)
  736.  FOURWORDINLINE(0x203C, 0x0002, 0x000D, 0xABEE);
  737.  
  738. extern pascal CMError NCMUseProfileComment(CMProfileRef prof, unsigned long flags)
  739.  FOURWORDINLINE(0x203C, 0x0008, 0x003B, 0xABEE);
  740.  
  741. extern pascal CMError CMCreateProfileIdentifier(CMProfileRef prof, CMProfileIdentifierPtr ident, unsigned long *size)
  742.  FOURWORDINLINE(0x203C, 0x000C, 0x0041, 0xABEE);
  743.  
  744. /* System Profile access */
  745. extern pascal CMError CMGetSystemProfile(CMProfileRef *prof)
  746.  FOURWORDINLINE(0x203C, 0x0004, 0x0018, 0xABEE);
  747.  
  748. extern pascal CMError CMSetSystemProfile(const FSSpec *profileFileSpec)
  749.  FOURWORDINLINE(0x203C, 0x0004, 0x0019, 0xABEE);
  750.  
  751. /* External Profile Management */
  752. extern pascal CMError CMNewProfileSearch(CMSearchRecord *searchSpec, void *refCon, unsigned long *count, CMProfileSearchRef *searchResult)
  753.  FOURWORDINLINE(0x203C, 0x0010, 0x0027, 0xABEE);
  754.  
  755. extern pascal CMError CMUpdateProfileSearch(CMProfileSearchRef search, void *refCon, unsigned long *count)
  756.  FOURWORDINLINE(0x203C, 0x000C, 0x0028, 0xABEE);
  757.  
  758. extern pascal void CMDisposeProfileSearch(CMProfileSearchRef search)
  759.  FOURWORDINLINE(0x203C, 0x0004, 0x0029, 0xABEE);
  760.  
  761. extern pascal CMError CMSearchGetIndProfile(CMProfileSearchRef search, unsigned long index, CMProfileRef *prof)
  762.  FOURWORDINLINE(0x203C, 0x000C, 0x002A, 0xABEE);
  763.  
  764. extern pascal CMError CMSearchGetIndProfileFileSpec(CMProfileSearchRef search, unsigned long index, FSSpec *profileFile)
  765.  FOURWORDINLINE(0x203C, 0x000C, 0x002B, 0xABEE);
  766.  
  767. extern pascal CMError CMProfileIdentifierFolderSearch(CMProfileIdentifierPtr ident, unsigned long *matchedCount, CMProfileSearchRef *searchResult)
  768.  FOURWORDINLINE(0x203C, 0x000C, 0x003F, 0xABEE);
  769.  
  770. extern pascal CMError CMProfileIdentifierListSearch(CMProfileIdentifierPtr ident, CMProfileRef *profileList, unsigned long listSize, unsigned long *matchedCount, CMProfileRef *matchedList)
  771.  FOURWORDINLINE(0x203C, 0x0014, 0x0040, 0xABEE);
  772.  
  773. /* Utilities */
  774. extern pascal CMError CMGetColorSyncFolderSpec(short vRefNum, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  775.  FOURWORDINLINE(0x203C, 0x000C, 0x0011, 0xABEE);
  776.  
  777. extern pascal CMError CMGetCWInfo(CMWorldRef cw, CMCWInfoRecord *info)
  778.  FOURWORDINLINE(0x203C, 0x0008, 0x001A, 0xABEE);
  779.  
  780. extern pascal CMError CMConvertProfile2to1(CMProfileRef profv2, CMProfileHandle *profv1)
  781.  FOURWORDINLINE(0x203C, 0x0008, 0x0045, 0xABEE);
  782.  
  783. /* ColorSpace conversion functions */
  784. extern pascal CMError CMConvertXYZToLab(const CMColor *src, const CMXYZColor *white, CMColor *dst, unsigned long count)
  785.  FOURWORDINLINE(0x203C, 0x0010, 0x004B, 0xABEE);
  786.  
  787. extern pascal CMError CMConvertLabToXYZ(const CMColor *src, const CMXYZColor *white, CMColor *dst, unsigned long count)
  788.  FOURWORDINLINE(0x203C, 0x0010, 0x004C, 0xABEE);
  789.  
  790. extern pascal CMError CMConvertXYZToLuv(const CMColor *src, const CMXYZColor *white, CMColor *dst, unsigned long count)
  791.  FOURWORDINLINE(0x203C, 0x0010, 0x004D, 0xABEE);
  792.  
  793. extern pascal CMError CMConvertLuvToXYZ(const CMColor *src, const CMXYZColor *white, CMColor *dst, unsigned long count)
  794.  FOURWORDINLINE(0x203C, 0x0010, 0x004E, 0xABEE);
  795.  
  796. extern pascal CMError CMConvertXYZToYxy(const CMColor *src, CMColor *dst, unsigned long count)
  797.  FOURWORDINLINE(0x203C, 0x000C, 0x004F, 0xABEE);
  798.  
  799. extern pascal CMError CMConvertYxyToXYZ(const CMColor *src, CMColor *dst, unsigned long count)
  800.  FOURWORDINLINE(0x203C, 0x000C, 0x0050, 0xABEE);
  801.  
  802. extern pascal CMError CMConvertRGBToHLS(const CMColor *src, CMColor *dst, unsigned long count)
  803.  FOURWORDINLINE(0x203C, 0x000C, 0x0051, 0xABEE);
  804.  
  805. extern pascal CMError CMConvertHLSToRGB(const CMColor *src, CMColor *dst, unsigned long count)
  806.  FOURWORDINLINE(0x203C, 0x000C, 0x0052, 0xABEE);
  807.  
  808. extern pascal CMError CMConvertRGBToHSV(const CMColor *src, CMColor *dst, unsigned long count)
  809.  FOURWORDINLINE(0x203C, 0x000C, 0x0053, 0xABEE);
  810.  
  811. extern pascal CMError CMConvertHSVToRGB(const CMColor *src, CMColor *dst, unsigned long count)
  812.  FOURWORDINLINE(0x203C, 0x000C, 0x0054, 0xABEE);
  813.  
  814. extern pascal CMError CMConvertRGBToGray(const CMColor *src, CMColor *dst, unsigned long count)
  815.  FOURWORDINLINE(0x203C, 0x000C, 0x0055, 0xABEE);
  816.  
  817. extern pascal CMError CMConvertXYZToFixedXYZ(const CMXYZColor *src, CMFixedXYZColor *dst, unsigned long count)
  818.  FOURWORDINLINE(0x203C, 0x000C, 0x0056, 0xABEE);
  819.  
  820. extern pascal CMError CMConvertFixedXYZToXYZ(const CMFixedXYZColor *src, CMXYZColor *dst, unsigned long count)
  821.  FOURWORDINLINE(0x203C, 0x000C, 0x0057, 0xABEE);
  822.  
  823. /* PS-related */
  824. extern pascal CMError CMGetPS2ColorSpace(CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  825.  FOURWORDINLINE(0x203C, 0x0014, 0x002E, 0xABEE);
  826.  
  827. extern pascal CMError CMGetPS2ColorRenderingIntent(CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  828.  FOURWORDINLINE(0x203C, 0x0014, 0x002F, 0xABEE);
  829.  
  830. extern pascal CMError CMGetPS2ColorRendering(CMProfileRef srcProf, CMProfileRef dstProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  831.  FOURWORDINLINE(0x203C, 0x0018, 0x0030, 0xABEE);
  832.  
  833. extern pascal CMError CMGetPS2ColorRenderingVMSize(CMProfileRef srcProf, CMProfileRef dstProf, unsigned long *vmSize, Boolean *preferredCMMnotfound)
  834.  FOURWORDINLINE(0x203C, 0x0010, 0x003D, 0xABEE);
  835.  
  836. /* ColorSync 1.0 functions which have parallel 2.0 counterparts */
  837. extern pascal CMError CWNewColorWorld(CMWorldRef *cw, CMProfileHandle src, CMProfileHandle dst)
  838.  FOURWORDINLINE(0x203C, 0x000C, 0x0000, 0xABEE);
  839.  
  840. extern pascal CMError ConcatenateProfiles(CMProfileHandle thru, CMProfileHandle dst, CMProfileHandle *newDst)
  841.  FOURWORDINLINE(0x203C, 0x000C, 0x000C, 0xABEE);
  842.  
  843. extern pascal CMError CMBeginMatching(CMProfileHandle src, CMProfileHandle dst, CMMatchRef *myRef)
  844.  FOURWORDINLINE(0x203C, 0x000C, 0x000A, 0xABEE);
  845.  
  846. extern pascal void CMDrawMatchedPicture(PicHandle myPicture, CMProfileHandle dst, Rect *myRect)
  847.  FOURWORDINLINE(0x203C, 0x000C, 0x0009, 0xABEE);
  848.  
  849. extern pascal CMError CMUseProfileComment(CMProfileHandle profile)
  850.  FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xABEE);
  851.  
  852. extern pascal void CMGetProfileName(CMProfileHandle myProfile, CMIString *IStringResult)
  853.  FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xABEE);
  854.  
  855. extern pascal long CMGetProfileAdditionalDataOffset(CMProfileHandle myProfile)
  856.  FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xABEE);
  857.  
  858. /* ProfileResponder functions */
  859. extern pascal CMError GetProfile(OSType deviceType, long refNum, CMProfileHandle aProfile, CMProfileHandle *returnedProfile)
  860.  FOURWORDINLINE(0x203C, 0x0010, 0x0005, 0xABEE);
  861.  
  862. extern pascal CMError SetProfile(OSType deviceType, long refNum, CMProfileHandle newProfile)
  863.  FOURWORDINLINE(0x203C, 0x000C, 0x0006, 0xABEE);
  864.  
  865. extern pascal CMError SetProfileDescription(OSType deviceType, long refNum, long deviceData, CMProfileHandle hProfile)
  866.  FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xABEE);
  867.  
  868. extern pascal CMError GetIndexedProfile(OSType deviceType, long refNum, CMProfileSearchRecordHandle search, CMProfileHandle *returnProfile, long *index)
  869.  FOURWORDINLINE(0x203C, 0x0014, 0x0012, 0xABEE);
  870.  
  871. extern pascal CMError DeleteDeviceProfile(OSType deviceType, long refNum, CMProfileHandle deleteMe)
  872.  FOURWORDINLINE(0x203C, 0x000C, 0x0013, 0xABEE);
  873.  
  874. #if OLDROUTINENAMES
  875. /* constants */
  876. typedef CMFlattenProcPtr CMFlattenProc;
  877. typedef CMBitmapCallBackProcPtr CMBitmapCallBackProc;
  878. typedef CMProfileFilterProcPtr CMProfileFilterProc;
  879.  
  880. enum {
  881.     CMTrap                        = cmTrap,
  882.     CMBeginProfile                = cmBeginProfile,
  883.     CMEndProfile                = cmEndProfile,
  884.     CMEnableMatching            = cmEnableMatching,
  885.     CMDisableMatching            = cmDisableMatching
  886. };
  887.  
  888. /* 1.0 Error codes, for compatibility with older applications. 1.0 CMM's may return obsolete error codes */
  889.  
  890. enum {
  891.     CMNoError                    = 0,                            /*    obsolete name, use noErr */
  892.     CMProfileError                = cmProfileError,
  893.     CMMethodError                = cmMethodError,
  894.     CMMemFullError                = -172,                            /*    obsolete, 2.0 uses memFullErr */
  895.     CMUnimplementedError        = -173,                            /*    obsolete, 2.0 uses unimpErr */
  896.     CMParamError                = -174,                            /*    obsolete, 2.0 uses paramErr */
  897.     CMMethodNotFound            = cmMethodNotFound,
  898.     CMProfileNotFound            = cmProfileNotFound,
  899.     CMProfilesIdentical            = cmProfilesIdentical,
  900.     CMCantConcatenateError        = cmCantConcatenateError,
  901.     CMCantXYZ                    = cmCantXYZ,
  902.     CMCantDeleteProfile            = cmCantDeleteProfile,
  903.     CMUnsupportedDataType        = cmUnsupportedDataType,
  904.     CMNoCurrentProfile            = cmNoCurrentProfile
  905. };
  906.  
  907.  
  908. enum {
  909.     qdSystemDevice                = cmSystemDevice,
  910.     qdGDevice                    = cmGDevice
  911. };
  912.  
  913.  
  914. enum {
  915.     kMatchCMMType                = cmMatchCMMType,
  916.     kMatchApplProfileVersion    = cmMatchApplProfileVersion,
  917.     kMatchDataType                = cmMatchDataType,
  918.     kMatchDeviceType            = cmMatchDeviceType,
  919.     kMatchDeviceManufacturer    = cmMatchDeviceManufacturer,
  920.     kMatchDeviceModel            = cmMatchDeviceModel,
  921.     kMatchDeviceAttributes        = cmMatchDeviceAttributes,
  922.     kMatchFlags                    = cmMatchFlags,
  923.     kMatchOptions                = cmMatchOptions,
  924.     kMatchWhite                    = cmMatchWhite,
  925.     kMatchBlack                    = cmMatchBlack
  926. };
  927.  
  928. /* types */
  929. typedef CMCMYKColor CMYKColor;
  930. typedef CMWorldRef CWorld;
  931. typedef long *CMGamutResult;
  932.  
  933. /* functions */
  934. #define EndMatching(myRef)                                                        CMEndMatching(myRef)
  935. #define EnableMatching(enableIt)                                                CMEnableMatchingComment(enableIt)
  936. #define GetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)    CMGetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)
  937. #define BeginMatching(src, dst, myRef)                                            CMBeginMatching(src, dst, myRef)
  938. #define DrawMatchedPicture(myPicture, dst, myRect)                                CMDrawMatchedPicture(myPicture, dst, myRect)
  939. #define UseProfile(profile)                                                        CMUseProfileComment(profile)
  940. #define GetProfileName(myProfile, IStringResult)                                CMGetProfileName(myProfile, IStringResult)
  941. #define GetProfileAdditionalDataOffset(myProfile)                                CMGetProfileAdditionalDataOffset(myProfile)
  942. #endif
  943.  
  944. /* PrGeneral parameter blocks */
  945. struct TEnableColorMatchingBlk {
  946.     short                             iOpCode;
  947.     short                             iError;
  948.     long                             lReserved;
  949.     THPrint                         hPrint;
  950.     Boolean                         fEnableIt;
  951.     SInt8                             filler;
  952. };
  953. typedef struct TEnableColorMatchingBlk TEnableColorMatchingBlk;
  954.  
  955. struct TRegisterProfileBlk {
  956.     short                             iOpCode;
  957.     short                             iError;
  958.     long                             lReserved;
  959.     THPrint                         hPrint;
  960.     Boolean                         fRegisterIt;
  961.     SInt8                             filler;
  962. };
  963. typedef struct TRegisterProfileBlk TRegisterProfileBlk;
  964.  
  965.  
  966. #if PRAGMA_ALIGN_SUPPORTED
  967. #pragma options align=reset
  968. #endif
  969.  
  970. #if PRAGMA_IMPORT_SUPPORTED
  971. #pragma import off
  972. #endif
  973.  
  974. #ifdef __cplusplus
  975. }
  976. #endif
  977.  
  978. #endif /* __CMAPPLICATION__ */
  979.  
  980.